#include <SpammerFactoryServer.h>

extern "C"
{
  IceBox::Service*
  createSpammerFactoryServer(Ice::CommunicatorPtr communicator)
  {
    return new SpammerFactoryServer;
  }
}

void
SpammerFactoryServer::start
(const std::string& name,
 const Ice::CommunicatorPtr& communicator,
 const Ice::StringSeq& args)
{
  Ice::PropertiesPtr properties;
  string adapter;
  string object;

  properties = communicator->getProperties();
  adapter = properties->getProperty("adapter");
  object = properties->getProperty("name");
  _adapter = communicator->createObjectAdapter(adapter);

  _adapter->add(new SpammerFactoryI, 
		communicator->stringToIdentity(object));
  _adapter->activate();
}
 
void
SpammerFactoryServer::stop()
{
  _adapter->deactivate();
}
